package com.demo.appcli;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.RestTemplate;

@Controller
public class appcontorller {
	
	@RequestMapping("test")
	@ResponseBody
	public String test() {
		return "hello word!";
		
	}
    
	@RequestMapping(value="test1")
	@ResponseBody
	public String test1() {
		RestTemplate restTemplate =new RestTemplate();
		String result =restTemplate.getForObject("http://www.baidu.com",String.class);
		return result;	
	}
	
//	@RequestMapping(name="test2")
//	public String test2(Model model) {
//		String gg="ce  shi";
//		model.addAttribute("name",gg);
//		return "app";
//		
//	}
	
	
	
	@RequestMapping("test3")
	public String test3() {
		
		return "user/user";
	}
	
	
}
